const mongoose = require('mongoose')

const otherConsumeRecord = new mongoose.Schema({
    origin: { // 该数据对应的源数据
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'otherConsume'
    },
    name: {
        type: String,
        required: true
    },
    img: {
        type: String,
        default: ""
    },
    cost: {
        type: Number,
        required: true
    },
    payMoney: {
        type: Number,
        required: true
    },
    type: { // 其他消费的类型
        type: Number,
        default: 1  // 1. 日用品 2. 房间设施 3. 食品
    },
    author: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'user'
    }
}, {versionKey: false, timestamps: {createdAt: 'create_time', updatedAt: 'update_time'}})

module.exports = mongoose.model('otherConsumeRecord', otherConsumeRecord)
